
<fieldset><legend>物料信息</legend>
{[include file="material/amount/_view.tpl"]}
</fieldset>

<fieldset><legend>盘点信息</legend>
<form id="form_add"><input type="hidden" name="id" value="{[$result.id]}" />
<input type="hidden" name="price" value="{[$result.price]}" />
<table>
	<tr>
		<td align="right">盘点人：</td>
		<td colspan="3"><input type="text" name="emp" id="emp" size="12" value="{[$smarty.session.id]}:{[$smarty.session.name]}" title="{[$t.emp_|emp:'盘点人']}">
		<input type="checkbox" name="t_emp" id="t_emp" value="{[$smarty.session.id]}:{[$smarty.session.name]}" checked> 自己</td>
	</tr>
	<tr>
		<td width="20%" align="right">盘点数量：</td>
		<td width="30%"><input type="text" name="amount" id="amount" size="12" value="{[$result.amount|string_float]}"></td>
		<td width="20%" align="right">盘点日期：</td>
		<td width="30%"><input type="text" name="date" id="date" size="12" value="{[$smarty.now|date_format:'%Y-%m-%d']}"></td>
	</tr>
	<tr>
		<td align="right">备注：</td>
		<td colspan="3"><textarea rows="2" name="content" cols="55"></textarea></td>
	</tr>
</table>
</form>
</fieldset>

<fieldset><legend>历史盘点</legend>
<table>
	<tr align="center">
		<th>序号</th>
		<th>盘点日期</th>
		<th>库存数量</th>
		<th>盘点数量</th>
		<th>盘点盈亏</th>
		<th>盘点人</th>
		<th>备注</th>
	</tr>
	{[foreach name=outer key=key item=item from=$history]} {[assign var="no" value="`$key+1`"]} {[assign var="total"
	value="`$total+$item.amount`"]}
	<tr align="center" onMouseOver="this.style.backgroundColor='#D2E4FC'" onMouseOut="this.style.backgroundColor=''">
		<td>{[$no]}</td>
		<td>{[$item.date]}</td>

		<td>{[$item.kc|string_float]}</td>
		<td>{[$item.pd|string_float]}</td>
		<td>{[$item.amount|string_float]}</td>
		<td><a href="javascript:void(0)" onclick="emp('{[$item.emp]}')">{[$item.emp_t]}</a></td>
		<td>{[$item.content|truncate:30]}</td>
	</tr>
	{[/foreach]}
	<tr>
		<td colspan="3"></td>
		<td align="center">合计</td>
		<td align="center">{[$total|string_float]}</td>
		<td colspan="2"></td>
	</tr>
</table>
</fieldset>

<script type="text/javascript" src="js/material/amount/pandian/add.js?r={[$smarty.now]}"></script>
